package com.hyt.it.ogt.pj.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hyt.core.base.BaseServiceImpl;
import com.hyt.it.ogt.pj.mapper.ProjectDataDownLoadRecordMapper;
import com.hyt.it.ogt.pj.model.entity.ProjectDataDownLoadRecord;
import com.hyt.it.ogt.pj.service.IProjectDataDownLoadRecordService;

/**
 */
@Service
public class ProjectDataDownLoadRecordServiceImpl extends BaseServiceImpl<ProjectDataDownLoadRecordMapper, ProjectDataDownLoadRecord> implements IProjectDataDownLoadRecordService {

	@Autowired
	private ProjectDataDownLoadRecordMapper projectDataDownLoadRecordMapper;

	@Override
	public ProjectDataDownLoadRecord getProjectDataDownLoadRecord(String projectId, String officeId, String fileType) throws Exception {
		return projectDataDownLoadRecordMapper.getLastOneByProjectAndFileType(projectId, officeId, fileType);
	}

	@Override
	public Integer getProjectDataDownLoadRecordTimes(String projectId, String officeId, String fileType) throws Exception {
		return projectDataDownLoadRecordMapper.getLastOneByProjectAndFileTypeTimes(projectId, officeId, fileType);
	}

	@Override
	public List<ProjectDataDownLoadRecord> getIsRunningDownloadZip(Set<String> projectIds, String type) {
		List<String> projectIdList = new ArrayList<String>(projectIds);
		return projectDataDownLoadRecordMapper.getIsRunningDownloadFileRecord(projectIdList, type);
	}

	
}
